<template>
  <div>
    <el-button type="primary" plain @click="add()">添 加</el-button>
    <v-add :obj="obj" ref="aa"></v-add>
    <v-list @edit="edit"></v-list>
  </div>
</template>
<script>
import vAdd from "./components/add.vue";
import vList from "./components/list.vue";
import { mapGetters, mapActions } from "vuex";
export default {
  props: [],
  components: {
    vAdd,
    vList,
  },
  data() {
    return {
      obj:{
        isTrue: false,
        isAdd: false,
      },
    };
  },
  computed: {
    ...mapGetters({}),
  },
  methods: {
    ...mapActions({}),
    add() {
      this.obj.isTrue = true;
      this.obj.isAdd = true;
    },
    edit(id) {
      this.obj.isTrue = true;
      this.obj.isAdd = false;
      this.$refs.aa.getOne(id);
    },
  },
  mounted() {},
};
</script>
<style scoped>
</style>